package day13;

import javax.swing.plaf.IconUIResource;
import java.util.Scanner;

/**
 * @author tongchen
 * @create 2023-03-20 19:48
 */
public class Main {
    public static void main(String[] args) {
        //创建输入案列
        Scanner scanner=new Scanner(System.in);
        int year=scanner.nextInt();
        int month=scanner.nextInt();
        int day=scanner.nextInt();
        //创建两个数组
        int []leap={31,29,31,30,31,30,31,31,30,31,30,31};
        int []nLeap={31,28,31,30,31,30,31,31,30,31,30,31};
        int days=0;
        //判断是否是闰年
        if(isLeap(year)){
            for(int i=0;i<month-1;i++){
                days+=leap[i];
            }
        }
        else{
            for(int i=0;i<month-1;i++){
                days+=nLeap[i];
            }
        }
        days+=day;
        System.out.println(days);
    }
public static boolean isLeap(int year){
        if((year%4==0&&year%100!=0)||year%400==0){
            return true;
        }
        return false;
}
}

